#ifndef BLUETOOTH_THREAD_H
#define BLUETOOTH_THREAD_H

#include "bluetooth_interface.h"
#include <QObject>
#include <QThread>
#include <QDebug>
#include <QProcess>
#include <QFile>
#include <QtBluetooth/QBluetoothSocket>
#include <QtBluetooth/QBluetoothUuid>

class bluetooth_thread : public QObject
{
    Q_OBJECT
public:
    explicit bluetooth_thread(QObject *parent = nullptr);
    void bluetoothRemove(QString btAddress);
    QString getBluetoothName();
    void bluetoothEnableFlag(bool flag);

signals:
    void send_bluetooth_msg(int ,QString );

public slots:
    void bluetooth_init_thread();
    void bluetooth_scan_thread();
    void bluetooth_scan_stop_thread();
    void bluetooth_pair_thread(QString btAddress);
    void bluetooth_connect_thread(QString btAddress);
    void device_discovered(const QBluetoothDeviceInfo &device);
    void scan_finished();
    void pair_finished(const QBluetoothAddress &device, QBluetoothLocalDevice::Pairing pairing);
    void bluetooth_scan_timer();
    void bluetooth_pair_timer();
    void bluetooth_connect_timer();

private:
    bluetooth_interface * g_bluetoothInterface;

};

#endif // BLUETOOTH_THREAD_H
